package com.example.project.projectspringcloud.dao.user;

import com.example.project.projectspringcloud.dao.BaseMapper;
import com.example.project.projectspringcloud.entity.user.RelationRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RelationRoleMenuMapper extends BaseMapper<RelationRoleMenu> {

    /**
     * get menu list by role id
     * ==============================================================================
     *
     * @param roleId
     * @return
     */
    List<Integer> getMenuListByRoleId(@Param("roleId") Integer roleId);

    /**
     * delete by role id
     * ==============================================================================
     *
     * @param roleId
     */
    void deleteByRoleId(@Param("roleId") Integer roleId);

    /**
     * delete by menu id
     * ==============================================================================
     *
     * @param idarr
     */
    void deleteByMenuId(@Param("menuIds") Integer[] idarr);
}